package com.second.common.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 课程
 * @TableName edu_course
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("edu_course")
@ApiModel(value="course对象", description="课程表")
public class Course implements Serializable {
    /**
     * 课程ID
     */
    @ApiModelProperty(value = "课程ID")
    @TableId(type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 课程讲师ID
     */
    @ApiModelProperty(value = "课程讲师ID")
    private String teacherId;

    /**
     * 课程专业ID
     */
    @ApiModelProperty(value = "课程专业ID")
    private String subjectId;

    /**
     * 课程专业父级ID
     */
    @ApiModelProperty(value = "课程专业父级ID")
    private String subjectParentId;

    /**
     * 课程标题
     */
    @ApiModelProperty(value = "课程标题")
    private String title;

    /**
     * 课程销售价格，设置为0则可免费观看
     */
    @ApiModelProperty(value = "课程销售价格，设置为0则可免费观看")
    private BigDecimal price;

    /**
     * 总课时
     */
    @ApiModelProperty(value = "总课时")
    private Integer lessonNum;

    /**
     * 课程封面图片路径
<<<<<<< HEAD
     *
     *
=======
>>>>>>> daf17d01ea3c6eb5573bbb253ab34698ce3f4002
     */
    @ApiModelProperty(value = "课程封面图片路径")
    private String cover;

    /**
     * 销售数量
     */
    @ApiModelProperty(value = "销售数量")
    private Integer buyCount;

    /**
     * 浏览数量
     */
    @ApiModelProperty(value = "浏览数量")
    private Integer viewCount;

    /**
     * 乐观锁
     */
    @ApiModelProperty(value = "乐观锁")
    private Integer version;

    /**
     * 课程状态 Draft未发布  Normal已发布
     */
    @ApiModelProperty(value = "课程状态 Draft未发布  Normal已发布")
    private String status;

    /**
     * 逻辑删除 1（true）已删除， 0（false）未删除
     */
    @ApiModelProperty(value = "逻辑删除 1（true）已删除， 0（false）未删除")
    private Integer isDeleted;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime gmtCreate;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime gmtModified;

    /**
     * 课程备注
     */
    @ApiModelProperty(value = "课程备注")
    private String remark;

    /**
     * 是否添加 0 否  1 是
     */
    @ApiModelProperty(value = "是否添加 0 否  1 是")
    private Integer isAdd;

    private static final long serialVersionUID = 1L;

    public Course(){

    }

}